﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using 简单三层架构.IDAL;
using 简单三层架构.Model;

namespace 简单三层架构.BLL
{
    public class Item
    {
        private static readonly IItem dal = new DAL.Item();

        public ItemInfo GetItem(int itemId)
        {
            return dal.GetItemByID(itemId);
        }

        public List<ItemInfo> GetAllItems()
        {
            return dal.GetAllItems();
        }

        public List<ItemInfo> GetItemsBySearch(string keyword)
        {
            return dal.GetItemsBySearch(keyword);
        }

        public List<ItemInfo> GetItemsByCategory(int categoryId)
        {
            return dal.GetItemsByCategory(categoryId);
        }

        public void Insert(ItemInfo item)
        {
            dal.Insert(item);
        }
    }
}